﻿using FastIOC.Annotation;
using FastIOC.Builder;
using FastIOC.Proxy;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test
{
    public class TransitionalMovieProxy : TransitionalMovie
    {
        private DefaultIntercept _interceptor = new DefaultIntercept();
        private TransitionalMovie _beproxy;

        public TransitionalMovieProxy()
        {
            _beproxy = (TransitionalMovieProxy)ContainerBuilder.GetInstance().ResolveAsClassProxyModel(typeof(TransitionalMovieProxy));
        }

        public override void Test1()
        {
            object result = null;
            try
            {
                TransitionManage.StartTransition(IsolationLevel.ReadCommitted);
                object[] parameters = new object[0];
                this._interceptor.Before(this, "Test1", parameters);
                DateTime now = DateTime.Now;
                base.Test1();
                DateTime now2 = DateTime.Now;
                result = null;
                this._interceptor.After(this, "Test1", result, now, now2);
                TransitionManage.DoCommit();
            }
            catch (Exception)
            {
                TransitionManage.DoRollBack();
                throw;
            }
        }
        public override string Test2()
        {
            object obj = null;
            try
            {
                TransitionManage.StartTransition(IsolationLevel.ReadCommitted);
                object[] parameters = new object[0];
                this._interceptor.Before(this, "Test2", parameters);
                DateTime now = DateTime.Now;
                string arg_37_0 = base.Test2();
                DateTime now2 = DateTime.Now;
                obj = arg_37_0;
                this._interceptor.After(this, "Test2", obj, now, now2);
                TransitionManage.DoCommit();
            }
            catch (Exception)
            {
                TransitionManage.DoRollBack();
                throw;
            }
            return (string)obj;
        }
        public override void Test3(string text)
        {
            object result = null;
            try
            {
                TransitionManage.StartTransition(IsolationLevel.ReadCommitted);
                object[] parameters = new object[]
			{
				text
			};
                this._interceptor.Before(this, "Test3", parameters);
                DateTime now = DateTime.Now;
                base.Test3(text);
                DateTime now2 = DateTime.Now;
                result = null;
                this._interceptor.After(this, "Test3", result, now, now2);
                TransitionManage.DoCommit();
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
